package com.fare.taluo.application.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import com.fare.taluo.core.domain.crawl.statistics.WaitingTaskEntity;

import com.fare.taluo.vo.core.WaitingTaskEntityVo;
import com.fare.taluo.application.WaitingTaskApplicaion;


@Transactional
@Scope("singleton")
@Service("waitingTaskApplicaion")
public class WaitingTaskApplicaionImpl implements WaitingTaskApplicaion{

	@Override
	public List<WaitingTaskEntityVo> getWaitingTaskByPage() {
		// TODO Auto-generated method stub
		try {
			WaitingTaskEntity wte = new WaitingTaskEntity();
			List<WaitingTaskEntity> listpo = wte.getWaitingTaskByPage();
			List<WaitingTaskEntityVo>listvo = new ArrayList<WaitingTaskEntityVo>();
			for(WaitingTaskEntity waitingTaskEntity : listpo){
				WaitingTaskEntityVo vo = new WaitingTaskEntityVo();
				vo.setGrabchannel(waitingTaskEntity.getGrabchannel());
				vo.setWaiting(waitingTaskEntity.getWaiting());
				listvo.add(vo);
			}
			return listvo;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	
		return null;
	}
	
}
